import { _decorator, Color, Component, Node } from 'cc';
import { ElementAction } from './ElementAction';
const { ccclass, property } = _decorator;

@ccclass('LayerAction')
export class LayerAction extends Component {

    private groupId: number = 0;
    
    start() {

    }

    update(deltaTime: number) {
        
    }

    initLayer(groupId: number, layerColor: Color) {
        this.groupId = groupId;
        this.node.children.forEach((element: Node) => {
            element.getComponent(ElementAction).initPin(groupId);
            element.getComponent(ElementAction).initColor(layerColor);
        })
    }
}


